import { defineConfig } from 'vite'
import viteCompression from 'vite-plugin-compression';
import vue from '@vitejs/plugin-vue'

export default defineConfig({
  plugins: [vue(), viteCompression()],
  build: {
    outDir: '../后端/dist'
  },
  server: {
    proxy: {
      "/apis": {
        target: "http://127.0.0.1:5002/",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/apis/, ""),
      },
      "/socket.io": {
        target: "http://127.0.0.1:5002",
        ws: true
      }
    },
  }
})
